import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);
import createPersistedState from "vuex-persistedstate"

export default new Vuex.Store({
  plugins: [createPersistedState()],
  state: {
    token: null,
    user: null,
    menuName: null,
    config: {}
  },
  mutations: {
    setToken(state, playLoad) {
      state.token = playLoad;
    },
    setUser(state, playLoad) {
      state.user = playLoad;
    },
    setMenuName(state, playLoad) {
      state.menuName = playLoad;
    },
    setConfig(state, playLoad) {
      state.config = playLoad;
    },
  },
  actions: {},
  modules: {}
})
